<include file="./Application/Home/View/Header/back_header.html"/>
<script src="__PUBLIC__/ckeditor/ckeditor.js"></script>
<script src="__PUBLIC__/ckfinder/ckfinder.js"></script>
<br>
  <script>
    CKEDITOR.disableAutoInline = true;
    var editor;
    $( document ).ready( function() {
        if (typeof CKEDITOR == 'undefined') {
            document.write('加载CKEditor失败');
        }
        else {
            editor = CKEDITOR.replace( 'editor1', { toolbar:'full', height:270 });
            
        }


      /*$( '#editor1' ).ckeditor(); // Use CKEDITOR.replace() if element is <textarea>.*/
    } );

  </script>

  <br/>
  <br/>
  <div class="container">
    <h1>添加消息</h1>
    <p>
      for user add News
      <br/>
      请尽情的使用吧~
    </p>
  </div>
  <hr/>
  <br/>

  <form action="__URL__/addNewsDetail" id="addActivityForm" method="post">
    <div class="container addTitle">
      <div class="col-md-2"></div>
      <div class="col-md-8">
        <div class="input-group">
          <span class="input-group-addon">新闻名</span>
          <input  class="form-control" id="acTitle" name="acTitle" placeholder="请输入标题..." maxlength="20"></div>
      </div>

      <div class="col-md-2"></div>
    </div>
    <div class="container addContext" style="padding-top: 20px; ">
      <div class="col-md-2"></div>
      <div class="col-md-8">
        <textarea cols="114" id="editor1" name="editor1" rows="10"></textarea>
      </div>

      <div class="col-md-2"></div>
    </div>
      <div class="container addTag" style="padding-top: 20px; ">
          <div class="col-md-2"></div>
          <div class="col-md-8">
                 <select id="tag" name="tag"  class="form-control">
                  <option value="最新消息">最新消息</option>
                  <option value="今日运营情况">今日运营情况</option>
                  <option value="公司介绍">公司介绍</option>
                  <option value="业务介绍">业务介绍</option>
                  <option value="投资优势">投资优势</option>
                  <option value="投资业绩">投资业绩</option>
                  <option value="控股未来">控股未来</option>
                  <option value="联系我们">联系我们</option>
                  <option value="公司地址">公司地址</option>
              </select>
          </div>
          <div class="col-md-2"></div>
      </div>

  <div class="container" style="text-align: right;padding-top: 20px;">
    <div class="col-md-2"></div>
    <div class="col-md-8">
      <p style="overflow: hidden">
        <a  onclick="submitForm()" class="btn btn-info">提交</a>
      </p>
    </div>
    <div class="col-md-2"></div>
  </div>
</form>

<script>
    function submitForm(){
/*      var content=  CKEDITOR.instances.editor1.getData();
      editor.updateElement();
      alert(content);*/
      var acTitle = $("#acTitle").val();
      var content=  CKEDITOR.instances.editor1.getData();
            if(acTitle!=""&&content!=""){
                $("#addActivityForm").submit();
            }else{
                alert("请输入..");
            }

    }
      function selectAcType(type){
       if (type==1) {
          $('.addLimit').hide().fadeIn();
            }else{
              $('.addLimit:visible').fadeOut();
            }
          }
          /*           $(function() {
                  // run the currently selected effect
                  function runEffect() {
                  // get effect type from
                  var selectedEffect = "slide";
                  // most effect types need no options passed by default
                  var options = {};
                  // some effects have required parameters
                  if ( selectedEffect === "scale" ) {
                  options = { percent: 0 };
                  } else if ( selectedEffect === "size" ) {
                  options = { to: { width: 200, height: 60 } };
                  }
                  // run the effect
                  $( ".acLimit" ).hide( selectedEffect, options, 1000, callback );
                  };
                  // callback function to bring a hidden box Back
                  function callback() {
                  setTimeout(function() {
                  $( ".acLimit" ).removeAttr( "style" ).hide().fadeIn();
                  }, 1000 );
                  };
                });*/
  </script>
